package com.xqboss.apps.mapper.box;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xqboss.apps.domain.box.Box;
import com.xqboss.apps.dto.PageDto;
import com.xqboss.apps.dto.box.BoxDto;
import com.xqboss.apps.dto.market.MarketDto;
import com.xqboss.apps.vo.box.BoxInfoVo;
import com.xqboss.apps.vo.box.BoxMallVo;
import com.xqboss.apps.vo.box.BoxVo;
import com.xqboss.apps.vo.market.MarketListVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author Administrator
 */
public interface BoxMapper extends BaseMapper<Box> {

    int addSimulatedCount(@Param("boxId") Long boxId, @Param("count") int count);

    int abatementSimulatedCount(@Param("boxId") Long boxId, @Param("count") int count);

    List<BoxVo> selectListByDto(BoxDto dto);

    List<BoxMallVo> selectAppListByDto(PageDto dto);

    BoxInfoVo payInfo(BoxDto dto);

    BoxInfoVo getCategoryInfo(Long boxId);

    List<MarketListVo> getBoxList(MarketDto dto);

    IPage<MarketListVo> getBoxListPlus(Page<MarketListVo> page,@Param("dto") MarketDto dto);

    BigDecimal selectMarketByBoxIdMin(@Param("boxId") Long boxId);

    BigDecimal selectMarketByBoxIdMax(@Param("boxId") Long boxId);

    Integer selectMarketByBoxIdSell(@Param("boxId") Long boxId);

    boolean updateBoxById(@Param("box") Box box);
}
